// pages/test/test/test.js
import instance from "../../../utils/http"
import { reqSwiperData } from "../../api/index"
Page({
   data: {
      dataList: [],
      avatarUrl: '../../../assets/images/girl-friend.png'
   },
   // handel () {
   //   instance.request({
   //    url:'https://gmall-prod.atguigu.cn/mall-api/index/findBanner',
   //    methods:'GET'
   //   }).then((res)=>{
   //      console.log(res.data.data);
   //   })
   // }

   // 异步执行
   async handel() {
      const res = await reqSwiperData()
      console.log(res);
   },

   async chooseavatar(event) {
      const { avatarUrl } = event.detail
      const { data: avatar } = await instance.upload('/fileUpload', avatarUrl, 'file')
      this.setData({
         avatarUrl: avatar
      })
   }



})